﻿using GraphDrawing2.V2.Concrete.States;

namespace GraphDrawing2.V2.Concrete.Model
{
    public class CreateHitTestStateVisitor : IHitTestResultVisitor<IState>
    {
        readonly Model2 model;

        public CreateHitTestStateVisitor(Model2 model)
        {
            this.model = model;
        }

        public IState OnNone(NoneHitTest test)
        {
            return new ViewPortTranslationState(model);
        }

        public IState OnElement(ElementHitTest element)
        {
            return new DraggingState(model, element);
        }

        public IState OnConnector(ConnectorHitTest connector)
        {
            return new LinkingState(model, connector);
        }
    }
}